package Demo1;

/**
 * Created with  IntelliJ IDEA .
 * Description:
 * User: lenovo
 * Date: 2025-11-20
 * Time: 14:30
 */
public class Test {

    public static void func(Animals animals){
        animals.eat();
    }

    public static void main1(String[] args) {

        func(new Bird("鸟",11));
        func(new Fish("小鱼儿",18));
        func(new Dog("旺财",15));

        new Bird("鸟",11).fly();
        new Dog("旺财",15).swim();
        new Dog("旺财",15).run();
        new Fish("小鱼儿",18).swim();



    }

    public static void main(String[] args) {
        Dog dog1 = new Dog("旺财",5);
        Dog dog2 = new Dog("旺财",5);

        System.out.println(dog1.equals(dog2));


    }
}
